import { getlist, invalidate } from "../../api/userauthorization";
const getDefaultState = () => {
  return {

  };
};

const state = getDefaultState();

const mutations = {

};
const actions =  {
  // 获取授权码列表
  getList({ commit }, data) {
    return new Promise((resolve,reject) => {
      getlist(data).then((res) => {
        console.log('res',res);
        resolve(res)
      }).catch(err => reject(err))
    })
  },
  // 作废授权码
  Invalidate({ commit }, ids) {
    return new Promise((resolve,reject) => {
      invalidate(ids).then((res) => {
        resolve(res)
      }).catch(err => {
     
        reject(err)
      })
    })
  }
}
export default {
  namespaced: true,
  state,
  mutations,
  actions,
}